import React, { Component } from "react";
import Check from "./check";
import List from "./list";

class ListType extends Component {
    state = {
        data: [...this.props.data]
    }
    render() {
        let {data}=this.state;
        return <div className="listType">
            <div>
                {
                    data.map((item,index) => {
                        return <div className="types" key={index}>
                           <h2 className="typeTitle"> <Check typeIndex={index} listIndex={-1} content={item.type} flg={item.typeFlg}/></h2>
                            <List data={{list:item.list,typeIndex:index}}/>
                        </div>
                    })
                }
            </div>
        </div>
    }
}

export default ListType;